﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000B5 RID: 181
	public class TOpenforStmt : TCustomSqlStatement
	{
		// Token: 0x0600061E RID: 1566 RVA: 0x002FE418 File Offset: 0x002FC618
		public TOpenforStmt() : this(EDbVendor.dbvoracle)
		{
		}

		// Token: 0x0600061F RID: 1567 RVA: 0x002FE422 File Offset: 0x002FC622
		public TOpenforStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sst_openforstmt;
		}

		// Token: 0x1700010E RID: 270
		// (get) Token: 0x06000620 RID: 1568 RVA: 0x002FE433 File Offset: 0x002FC633
		// (set) Token: 0x06000621 RID: 1569 RVA: 0x002FE43B File Offset: 0x002FC63B
		public virtual TSelectSqlStatement Subquery
		{
			get
			{
				return this.subquery;
			}
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x06000622 RID: 1570 RVA: 0x002FE444 File Offset: 0x002FC644
		internal override void buildsql()
		{
		}

		// Token: 0x06000623 RID: 1571 RVA: 0x002FE446 File Offset: 0x002FC646
		internal override void clear()
		{
		}

		// Token: 0x06000624 RID: 1572 RVA: 0x002FE448 File Offset: 0x002FC648
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000625 RID: 1573 RVA: 0x002FE44F File Offset: 0x002FC64F
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06000626 RID: 1574 RVA: 0x002FE454 File Offset: 0x002FC654
		public override void init(object arg1, object arg2)
		{
			this.cursorVariableName = (TObjectName)arg1;
			if (arg2 is TSelectSqlStatement)
			{
				this.subquery = (TSelectSqlStatement)arg2;
				return;
			}
			if (arg2 is TSelectSqlNode)
			{
				this.selectSqlNode = (TSelectSqlNode)arg2;
				return;
			}
			this.dynamic_string = (TExpression)arg2;
		}

		// Token: 0x06000627 RID: 1575 RVA: 0x002FE4A4 File Offset: 0x002FC6A4
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			base.doParseStatement(psql);
			if (this.subquery != null)
			{
				this.subquery.parsestatement(this, false);
			}
			else if (this.selectSqlNode != null)
			{
				this.subquery = new TSelectSqlStatement(this.dbvendor);
				this.subquery.rootNode = this.selectSqlNode;
				this.subquery.doParseStatement(this);
			}
			return 0;
		}

		// Token: 0x1700010F RID: 271
		// (get) Token: 0x06000628 RID: 1576 RVA: 0x002FE509 File Offset: 0x002FC709
		// (set) Token: 0x06000629 RID: 1577 RVA: 0x002FE511 File Offset: 0x002FC711
		public virtual TObjectName CursorVariableName
		{
			get
			{
				return this.cursorVariableName;
			}
			set
			{
				this.cursorVariableName = value;
			}
		}

		// Token: 0x17000110 RID: 272
		// (get) Token: 0x0600062A RID: 1578 RVA: 0x002FE51A File Offset: 0x002FC71A
		// (set) Token: 0x0600062B RID: 1579 RVA: 0x002FE522 File Offset: 0x002FC722
		public virtual TExpression Dynamic_string
		{
			get
			{
				return this.dynamic_string;
			}
			set
			{
				this.dynamic_string = value;
			}
		}

		// Token: 0x0600062C RID: 1580 RVA: 0x002FE52B File Offset: 0x002FC72B
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x0600062D RID: 1581 RVA: 0x002FE53B File Offset: 0x002FC73B
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.subquery != null)
			{
				this.subquery.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001181 RID: 4481
		private TSelectSqlStatement subquery;

		// Token: 0x04001182 RID: 4482
		private TSelectSqlNode selectSqlNode;

		// Token: 0x04001183 RID: 4483
		private TObjectName cursorVariableName;

		// Token: 0x04001184 RID: 4484
		private TExpression dynamic_string;
	}
}
